@forelse($business as $item)
<div class="list">
	@foreach($item->activitys as $activity)
	@php
		$types = $activity->types()->where('business_id',$item->id)->orderBy('created_at','asc')->get();
	@endphp
	@foreach($types as $type)
	@if($loop->first && $loop->parent->first)
	<ul>
		<li class="icon active" title="{{$item->name}}">{{$item->name}}</li>
		<li title="{{$activity->name}}">{{$activity->name}}</li>
		<li title="{{$type->name}}">{{$type->name}}</li>
		<li title="{{$type->pivot->created_at}}">{{$type->pivot->created_at}}</li>
		<li><span id="add" data-id="{{$type->pivot->id}}" data-type="activity" data-id="{{$item->id}}">新增活动</span> |
			<span id="add" data-id="{{$type->pivot->id}}" data-type="type" data-id="{{$activity->id}}">新增渠道</span> |
			<span id="edit" data-type="business" data-id="{{$type->pivot->id}}">编辑</span> |
			<span id="del">删除</span>
		</li>
	</ul>
	@endif
	@if($loop->parent->index ==0 && $loop->index > 0)
	@if($loop->index == 1)
	<div class="list table_content">
	@endif
	<ul>
		<li></li><li></li><li class="icon1">{{$type->name}}</li><li>{{$type->pivot->created_at}}</li><li><span id="edit" data-type="type" data-id="{{$type->pivot->id}}">编辑</span> | <span id="del">删除</span></li>
	</ul>
	@if($loop->last)
	</div>
	@endif
	@endif
	@if($loop->parent->index > 0)
	@if($loop->first)
	<ul>
		<li></li>
		<li class="icon1" title="{{$activity->name}}">{{$activity->name}}</li>
		<li title="{{$type->name}}">{{$type->name}}</li>
		<li title="{{$type->pivot->created_at}}">{{$type->pivot->created_at}}</li>
		<li>
			<span id="add" data-type="type" data-id="{{$type->pivot->id}}">新增渠道</span>|
			<span id="edit" data-type="activity" data-id="{{$type->pivot->id}}">编辑</span>|
			<span id="del">删除</span>
		</li>
	</ul>
	@endif
	@continue($loop->first)
	@if($loop->index == 1)
	<div class="list table_content">
	@endif
	<ul>
		<li></li><li></li><li class="icon1">{{$type->name}}</li><li>{{$type->pivot->created_at}}</li><li><span id="edit" data-type="type" data-id="{{$type->pivot->id}}">编辑</span> | <span id="del">删除</span></li>
	</ul>
	@if($loop->last)
	</div>
	@endif
	@endif
	@endforeach
	@endforeach
</div>
@empty
<div>
	<table class="no_data" >
		<tr><td><span>当前暂无商家</span></td></tr>
	</table>
</div>
@endforelse